package org.cloud.service;

import org.cloud.entity.Dept;
import org.springframework.stereotype.Component;

import java.util.List;


// 备选响应类 提供备选方法
@Component
public class DeptClientServiceFallback implements DeptClientService{
    @Override
    public List<Dept> listDept() {
        return null;
    }

    @Override
    public boolean addDept(Dept dept) {
        return false;
    }

    @Override
    public Dept getDept(Integer id) {
        Dept dept = new Dept();
        dept.setDName("此ID: " + id+"没有对应数据, Consumer 提供降级信息,Provider已经关闭");
        dept.setDbSource("MySQL中不存在对应数据");
        return dept;
    }

    @Override
    public Object discovery(String serviceId) {
        return null;
    }

    @Override
    public void offLine() {

    }
}
